/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package mb.webserver.inMemory;

import mb.config.Constants;
import mb.config.ConstantsMsg;
import mb.mbmiddle.MbPartMiddle;
import mb.mbpart.memory.BaseMemory;

/**
 *
 * @author thanh.nguyenchi
 */
public class ListFunctionProcess extends BaseProcess{
        
    String sOut;
    String lang;
    public ListFunctionProcess(String lang){
        this.lang = lang;
        process();
    }
    
     @Override
    public void process(){
        status = ConstantsMsg.INT_SUCESSFUL_CODE;        
        
        BaseMemory objMem = (BaseMemory)MbPartMiddle.objMemory.get(Constants.STR_MEM_CATEGORIES);  
        if (objMem != null){
            sOut = objMem.getData();
        }
        else{                
            sOut = "[]";
        }        
        return;
    }
    
    @Override
    public String toJson(){
        String sResult = "";
        sResult = "{\"data\":" + sOut + "}";
        return sResult;
    }
       
}
